<div class="tabbable tabs-left">
              <ul class="nav nav-tabs">
              	<li><h5><?php echo $this->translate('客户设置'); ?></h5></li>
                <li class="active"><a data-toggle="tab" href="#user_set_a"><?php echo $this->translate('基本设置'); ?></a></li>
				<li><a data-toggle="tab" href="#user_set_c"><?php echo $this->translate('注册与登录'); ?></a></li>
                <li><a data-toggle="tab" href="#user_set_b"><?php echo $this->translate('第三方登录'); ?></a></li>
              </ul>
              <form class="form-horizontal" enctype="multipart/form-data" name="userset_form" id="userset_form" method="post">
              <div class="tab-content">
    			<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        			<div class="pull-left" style="font-size:16px;line-height:30px;"><strong><?php echo $this->translate('客户设置'); ?></strong></div>
        			<div class="pull-right">
        			<a href="<?php echo $this->serverUrl(true); ?>" class="btn btn-small btn-warning"><i class="icon-repeat icon-white"></i> <?php echo $this->translate('刷新'); ?></a>&nbsp;
                	<button type="submit" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存客户设置'); ?></button>&nbsp;
<!--                	<a href="--><?php //echo $this->myviewalias()->dbshopHelpUrl('user_set'); ?><!--" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> --><?php //echo $this->translate('查看帮助说明'); ?><!--</a>-->
                	</div>
        		</div>
                <div id="user_set_a" class="tab-pane active">
                	<div class="well admin_add_header_well"><?php echo $this->translate('基本设置'); ?></div>
                	<div class="well admin_add_well">
                	    <div class="message_one">
                    	</div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('客户注册状态'); ?>：</label>
           					<div class="controls">
              					<label class="radio inline"><input type="radio" name="user_register_state" value="true" <?php if((isset($this->user_config) and $this->user_config['user_register_state'] == 'true') or !isset($this->user_config)) echo 'checked="checked"'; ?>><?php echo $this->translate('开启'); ?></label>
                                <label class="radio inline"><input type="radio" name="user_register_state" value="false" <?php if(isset($this->user_config) and $this->user_config['user_register_state'] == 'false') echo 'checked="checked"'; ?>><?php echo $this->translate('关闭'); ?></label>
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('注册关闭显示信息'); ?>：</label>
           					<div class="controls">
              					<textarea class="span8" name="register_close_message" id="register_close_message" rows="4"><?php if(isset($this->user_config)) echo $this->escapeHtml($this->user_config['register_close_message']); ?></textarea>
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('默认头像'); ?>：</label>
           					<div class="controls">
                            	<?php if(isset($this->user_config['default_avatar']) and !empty($this->user_config['default_avatar'])) { ?>
                                <img src="<?php echo $this->basePath($this->user_config['default_avatar']); ?>" />
                                <input type="hidden" name="old_default_avatar" id="old_default_avatar" value="<?php echo $this->user_config['default_avatar']; ?>" />
                                <?php } ?>
              					<input type="file" name="default_avatar" id="default_avatar" /><?php echo $this->myviewalias()->defaultShopSet('shop_user_avatar'); ?>
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('客户注册默认组'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<select id="default_group_id" name="default_group_id" class="span2">
                                <option value=""><?php echo $this->translate('请选择'); ?></option>
                                <?php if($this->group_array) {
                                	foreach ($this->group_array as $group_val) {
                                ?>
                                <option value="<?php echo $group_val['group_id']; ?>" <?php if($this->user_config and $this->user_config['default_group_id']==$group_val['group_id']) { echo 'selected="selected"'; } ?>><?php echo $group_val['group_name']; ?></option>
                                <?php }
                                }
                                ?>
                                </select>
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('新客户注册验证'); ?>：</label>
           					<div class="controls">
              					<select name="register_audit" id="register_audit" class="span2">
                                <option value="null" <?php if($this->user_config and $this->user_config['register_audit']=='null') { echo 'selected="selected"'; } ?>><?php echo $this->translate('无需验证'); ?></option>
                                <option value="email" <?php if($this->user_config and $this->user_config['register_audit']=='email') { echo 'selected="selected"'; } ?>><?php echo $this->translate('注册邮箱验证'); ?></option>
                                <option value="audit" <?php if($this->user_config and $this->user_config['register_audit']=='audit') { echo 'selected="selected"'; } ?>><?php echo $this->translate('人工审核验证'); ?></option>
                                </select>
            				</div>                        
                        </div>                        
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('客户注册保留关键字'); ?>：</label>
           					<div class="controls">
              					<textarea class="span8" rows="4" name="register_retain" id="register_retain"><?php if(isset($this->user_config)) echo $this->escapeHtml($this->user_config['register_retain']); ?></textarea>
                                <i class="cus-help shop_admin_help_note" data-content="<?php echo $this->translate('输入注册客户名限制内容并用 | 分割，如 管理员|超级管理员|店主'); ?>"></i>
            				</div>                        
                        </div> 
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('发送欢迎Email'); ?>：</label>
           					<div class="controls">
              					<input type="checkbox" name="welcomeemail" id="welcomeemail" <?php if(isset($this->user_config) and $this->user_config['welcomeemail'] == 'true') echo 'checked="checked"'; ?> value="true">
            				</div>                        
                        </div>                    	
                        <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('欢迎Email标题'); ?>：</label>
           					<div class="controls">
              					<input type="text" name="welcome_email_title" id="welcome_email_title" value="<?php if(isset($this->user_config)) echo $this->escapeHtml($this->user_config['welcome_email_title']); ?>" class="span8">
							<i class="cus-help shop_admin_help_note" data-content="<?php echo $this->translate('{username} 表示注册的会员名称<br>{shopname} 表示网店名称<br>{shopnameurl} 表示带url地址的店铺名称<br>{adminemail} 管理员邮箱<br>{time} 注册时间，精确到分钟'); ?>"></i>
            				</div>                        
                        </div>                        
                        <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('欢迎Email内容'); ?>：</label>
           					<div class="controls">
              					<textarea class="span8" name="welcome_email_body" id="welcome_email_body" rows="5"><?php if(isset($this->user_config)) echo $this->escapeHtml($this->user_config['welcome_email_body']); ?></textarea>
                            <i class="cus-help shop_admin_help_note" data-content="<?php echo $this->translate('{username} 表示注册的会员名称<br>{shopname} 表示网店名称<br>{shopnameurl} 表示带url地址的店铺名称<br>{adminemail} 管理员邮箱<br>{time} 注册时间，精确到分钟'); ?>"></i>
            				</div>                        
                        </div>
                         <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('客户注册协议'); ?>：</label>
           					<div class="controls">
              					<textarea class="span8" name="user_register_body" id="user_register_body" rows="10"><?php if(isset($this->user_config)) echo $this->escapeHtml($this->user_config['user_register_body']); ?></textarea>
            				</div>                        
                        </div>                                                                                                                                              
                  	</div>
                </div>
                <div id="user_set_b" class="tab-pane">
                    <div class="well admin_add_header_well"><?php echo $this->translate('第三方登录'); ?></div>
                    <div class="well admin_add_well">
                        <div class="message_one"></div>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('前台顶部'); ?>：</label>
							<div class="controls">
								<label class="checkbox"><input type="checkbox" name="front_other_login_show" value="1" <?php if(isset($this->user_config['front_other_login_show']) and $this->user_config['front_other_login_show'] == 1) echo 'checked'; ?>><?php echo $this->translate('显示'); ?></label>
							</div>
						</div>
						<hr>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('QQ互联登录'); ?>：</label>
                            <div class="controls">
                                <label class="radio inline"><input type="radio" name="qq_login_state" value="true" <?php if(isset($this->user_config['qq_login_state']) and $this->user_config['qq_login_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('开启'); ?></label>
                                <label class="radio inline"><input type="radio" name="qq_login_state" value="false" <?php if((isset($this->user_config['qq_login_state']) and $this->user_config['qq_login_state'] == 'false') or !isset($this->user_config['qq_login_state'])) echo 'checked="checked"'; ?>><?php echo $this->translate('关闭'); ?></label>
                            </div>
                        </div>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('回调地址'); ?>：</label>
							<div class="controls">
								<label style="line-height: 30px;"><?php echo $this->frontwebsite()->dbshopHttpHost() . $this->url('frontuser/default',array('action'=>'othercallback')); ?></label>
							</div>
						</div>
                        <div class="control-group">
                            <label for="input01" class="control-label">APP ID：</label>
                            <div class="controls">
                                <input type="text" name="qq_app_id" id="qq_app_id" value="<?php if(isset($this->login_config['QQ']['app_id'])) echo $this->escapeHtml($this->login_config['QQ']['app_id']); ?>" class="span6"> <a href="http://wiki.open.qq.com/wiki/website/%E7%BD%91%E7%AB%99%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B" class="btn btn-small btn-info" target="_blank"><?php echo $this->translate('点击查看如何获取QQ互联的APP ID 和 APP KEY'); ?></a>
                            </div>
                        </div>
                        <div class="control-group">
                            <label for="input01" class="control-label">APP KEY：</label>
                            <div class="controls">
                                <input type="text" name="qq_app_key" id="qq_app_key" value="<?php if(isset($this->login_config['QQ']['app_key'])) echo $this->escapeHtml($this->login_config['QQ']['app_key']); ?>" class="span6">
                            </div>
                        </div>
						<hr>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('微信登录(微信内)'); ?>：</label>
							<div class="controls">
								<label class="radio inline"><input type="radio" name="weixin_phone_login_state" value="true" <?php if(isset($this->user_config['weixin_phone_login_state']) and $this->user_config['weixin_phone_login_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('开启'); ?></label>
								<label class="radio inline"><input type="radio" name="weixin_phone_login_state" value="false" <?php if((isset($this->user_config['weixin_phone_login_state']) and $this->user_config['weixin_phone_login_state'] == 'false') or !isset($this->user_config['weixin_phone_login_state'])) echo 'checked="checked"'; ?>><?php echo $this->translate('关闭'); ?></label>
							</div>
						</div>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('授权回调域'); ?>：</label>
							<div class="controls">
								<label style="line-height: 30px;"><?php echo str_replace(array('http://', 'https://'), '', $this->serverUrl()); ?></label>
							</div>
						</div>
						<div class="control-group">
							<label for="input01" class="control-label">AppID：</label>
							<div class="controls">
								<input type="text" name="weixin_phone_app_id" id="weixin_phone_app_id" value="<?php if(isset($this->login_config['Weixinphone']['app_id'])) echo $this->escapeHtml($this->login_config['Weixinphone']['app_id']); ?>" class="span6"> <a href="https://mp.weixin.qq.com/" class="btn btn-small btn-info" target="_blank"><?php echo $this->translate('点击去获取微信内登录的AppID 和 AppSecret'); ?></a>
							</div>
						</div>
						<div class="control-group">
							<label for="input01" class="control-label">AppSecret：</label>
							<div class="controls">
								<input type="text" name="weixin_phone_app_secret" id="weixin_phone_app_secret" value="<?php if(isset($this->login_config['Weixinphone']['app_secret'])) echo $this->escapeHtml($this->login_config['Weixinphone']['app_secret']); ?>" class="span6">
							</div>
						</div>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('自动登录'); ?>：</label>
                            <div class="controls">
                                <label class="checkbox"><input type="checkbox" name="weixin_auto_login" value="1" <?php if(isset($this->login_config['Weixinphone']['weixin_auto_login']) and $this->login_config['Weixinphone']['weixin_auto_login'] == 1) echo 'checked'; ?>><?php echo $this->translate('自动登录开启'); ?>&nbsp;&nbsp;<small>(<?php echo $this->translate('测试登录正常后，再决定是否开启此功能'); ?>)</small></label>

                            </div>
                        </div>
						<hr>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('微信登录(网站)'); ?>：</label>
							<div class="controls">
								<label class="radio inline"><input type="radio" name="weixin_login_state" value="true" <?php if(isset($this->user_config['weixin_login_state']) and $this->user_config['weixin_login_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('开启'); ?></label>
								<label class="radio inline"><input type="radio" name="weixin_login_state" value="false" <?php if((isset($this->user_config['weixin_login_state']) and $this->user_config['weixin_login_state'] == 'false') or !isset($this->user_config['weixin_login_state'])) echo 'checked="checked"'; ?>><?php echo $this->translate('关闭'); ?></label>
							</div>
						</div>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('授权回调域'); ?>：</label>
							<div class="controls">
								<label style="line-height: 30px;"><?php echo str_replace(array('http://', 'https://'), '', $this->serverUrl()); ?></label>
							</div>
						</div>
						<div class="control-group">
							<label for="input01" class="control-label">AppID：</label>
							<div class="controls">
								<input type="text" name="weixin_app_id" id="weixin_app_id" value="<?php if(isset($this->login_config['Weixin']['app_id'])) echo $this->escapeHtml($this->login_config['Weixin']['app_id']); ?>" class="span6"> <a href="https://open.weixin.qq.com/" class="btn btn-small btn-info" target="_blank"><?php echo $this->translate('点击去获取微信网站登录的AppID 和 AppSecret'); ?></a>
							</div>
						</div>
						<div class="control-group">
							<label for="input01" class="control-label">AppSecret：</label>
							<div class="controls">
								<input type="text" name="weixin_app_secret" id="weixin_app_secret" value="<?php if(isset($this->login_config['Weixin']['app_secret'])) echo $this->escapeHtml($this->login_config['Weixin']['app_secret']); ?>" class="span6">
							</div>
						</div>
                        <hr>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('支付宝登录(新)'); ?>：</label>
                            <div class="controls">
                                <label class="radio inline"><input type="radio" name="new_alipay_login_state" value="true" <?php if(isset($this->user_config['new_alipay_login_state']) and $this->user_config['new_alipay_login_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('开启'); ?></label>
                                <label class="radio inline"><input type="radio" name="new_alipay_login_state" value="false" <?php if((isset($this->user_config['new_alipay_login_state']) and $this->user_config['new_alipay_login_state'] == 'false') or !isset($this->user_config['new_alipay_login_state'])) echo 'checked="checked"'; ?>><?php echo $this->translate('关闭'); ?></label>
                                <label class="inline" style="color: red;"><?php echo $this->translate('本登录要求，必须为 php5.5 以上版本才可正常使用'); ?></label>
                            </div>
                        </div>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('回调地址'); ?>：</label>
                            <div class="controls">
                                <label style="line-height: 30px;"><?php echo $this->frontwebsite()->dbshopHttpHost() . $this->url('frontuser/default',array('action'=>'othercallback')); ?></label>
                            </div>
                        </div>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('AppID'); ?>：</label>
                            <div class="controls">
                                <input type="text" name="ali_app_id" id="ali_app_id" value="<?php if(isset($this->login_config['Newalipay']['ali_app_id'])) echo $this->escapeHtml($this->login_config['Newalipay']['ali_app_id']); ?>" class="span6"> <a href="http://help.dbshop.net/index.php?title=%E5%AE%A2%E6%88%B7%E8%AE%BE%E7%BD%AE#.E6.94.AF.E4.BB.98.E5.AE.9D.E7.99.BB.E5.BD.95.EF.BC.88.E6.96.B0.EF.BC.89" class="btn btn-small btn-info" target="_blank"><?php echo $this->translate('点击查看支付宝登录配置'); ?></a>
                            </div>
                        </div>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('私钥'); ?>：</label>
                            <div class="controls">
                                <textarea name="ali_private_key" id="ali_private_key" class="span6"><?php if(isset($this->login_config['Newalipay']['ali_private_key'])) echo $this->escapeHtml($this->login_config['Newalipay']['ali_private_key']); ?></textarea>
                            </div>
                        </div>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('公钥'); ?>：</label>
                            <div class="controls">
                                <textarea name="ali_public_key" id="ali_public_key" class="span6"><?php if(isset($this->login_config['Newalipay']['ali_public_key'])) echo $this->escapeHtml($this->login_config['Newalipay']['ali_public_key']); ?></textarea>
                            </div>
                        </div>
						<hr>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('支付宝登录'); ?>：</label>
							<div class="controls">
								<label class="radio inline"><input type="radio" name="alipay_login_state" value="true" <?php if(isset($this->user_config['alipay_login_state']) and $this->user_config['alipay_login_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('开启'); ?></label>
								<label class="radio inline"><input type="radio" name="alipay_login_state" value="false" <?php if((isset($this->user_config['alipay_login_state']) and $this->user_config['alipay_login_state'] == 'false') or !isset($this->user_config['alipay_login_state'])) echo 'checked="checked"'; ?>><?php echo $this->translate('关闭'); ?></label>
							</div>
						</div>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('合作者身份 Pid'); ?>：</label>
							<div class="controls">
								<input type="text" name="alipay_pid" id="alipay_pid" value="<?php if(isset($this->login_config['Alipay']['alipay_pid'])) echo $this->escapeHtml($this->login_config['Alipay']['alipay_pid']); ?>" class="span6"> <a href="https://www.alipay.com/" class="btn btn-small btn-info" target="_blank"><?php echo $this->translate('点击去获取支付宝登录的Pid 和 Key'); ?></a>
							</div>
						</div>
						<div class="control-group">
							<label for="input01" class="control-label"><?php echo $this->translate('安全校验码 Key'); ?>：</label>
							<div class="controls">
								<input type="text" name="alipay_key" id="alipay_key" value="<?php if(isset($this->login_config['Alipay']['alipay_key'])) echo $this->escapeHtml($this->login_config['Alipay']['alipay_key']); ?>" class="span6">
							</div>
						</div>
                    </div>
                </div>

				  <div id="user_set_c" class="tab-pane">
					  <div class="well admin_add_header_well"><?php echo $this->translate('注册与登录'); ?></div>
					  <div class="well admin_add_well">
						  <div class="message_one"></div>
						  <div class="control-group">
							  <div class="controls">
								  <label class="inline">
									<b><?php echo $this->translate('系统注册项设置'); ?></b>
								  </label>
							  </div>
						  </div>
						  <div class="control-group">
							  <label for="input01" class="control-label"><?php echo $this->translate('电子邮箱'); ?>：</label>
							  <div class="controls">
								  <label class="checkbox">
									  <input type="checkbox" name="register_email_state" value="true" <?php if(isset($this->reg_or_login['register_email_state']) and $this->reg_or_login['register_email_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('启用'); ?>
								  </label>
							  </div>
						  </div>
						  <div class="control-group">
							  <label for="input01" class="control-label"><?php echo $this->translate('电话号码'); ?>：</label>
							  <div class="controls">
								  <label class="checkbox">
									  <input type="checkbox" name="register_phone_state" value="true" <?php if(isset($this->reg_or_login['register_phone_state']) and $this->reg_or_login['register_phone_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('启用'); ?>
								  </label>
							  </div>
						  </div>
						  <hr>
						  <div class="control-group">
							  <div class="controls">
								  <label class="inline">
									  <b><?php echo $this->translate('系统登录项设置'); ?></b>
								  </label>
							  </div>
						  </div>
						  <div class="control-group">
							  <label for="input01" class="control-label"><?php echo $this->translate('可用登录名'); ?>：</label>
							  <div class="controls">
								  <label class="checkbox inline">
									  <input type="checkbox" readonly disabled checked><?php echo $this->translate('客户名称'); ?>
								  </label>
								  <label class="checkbox inline">
									  <input type="checkbox" name="login_email_state" value="true" <?php if(isset($this->reg_or_login['login_email_state']) and $this->reg_or_login['login_email_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('电子邮箱'); ?>
								  </label>
								  <label class="checkbox inline">
									  <input type="checkbox" name="login_phone_state" value="true" <?php if(isset($this->reg_or_login['login_phone_state']) and $this->reg_or_login['login_phone_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('手机号码'); ?>
								  </label>
							  </div>
						  </div>
						  <hr>
						  <div class="control-group">
							  <div class="controls">
								  <label class="inline">
									  <b><?php echo $this->translate('第三方登录设置项（前提 您已经开启了第三方登录）'); ?></b>
								  </label>
							  </div>
						  </div>
						  <div class="control-group">
							  <label for="input01" class="control-label"><?php echo $this->translate('电子邮箱'); ?>：</label>
							  <div class="controls">
								  <label class="checkbox">
									  <input type="checkbox" name="other_login_email_state" value="true" <?php if(isset($this->reg_or_login['other_login_email_state']) and $this->reg_or_login['other_login_email_state'] == 'true') echo 'checked="checked"'; ?>><?php echo $this->translate('启用'); ?>
									  <font size="1">(<?php echo $this->translate('这里的启用是指 第三方登录时，是否需要填写电子邮箱'); ?>)</font>
								  </label>
							  </div>
						  </div>
					  </div>
				  </div>

             </div>
              </form>
</div>
<script>
<?php if ($this->success_msg != '') { ?>
show_message('.message_one','<?php echo date("Y-m-d H:i:s"); ?>','<?php echo $this->success_msg; ?>','alert-success');
<?php } ?>

//系统设置保存
$(document).ready(function() {
	$("#userset_form").validate({
		rules: {
			default_group_id: {
				required: true
			}
		},
		messages: {
			default_group_id: {
				required: "<?php echo $this->translate('请选择客户默认组！'); ?>"
			}
		}
	});
});
</script>